import request from '@/utils/request';

// 获取教师的课程列表
export function getTeacherCourses(teacherId, page = 1, size = 10) {
  return request({
    url: `/api/courses/teacher/${teacherId}`,
    method: 'get',
    params: { page, size }
  });
}

// 获取课程详情
export function getCourseById(id) {
  return request({
    url: `/api/courses/${id}`,
    method: 'get'
  });
}

// 创建课程
export function createCourse(data) {
  return request({
    url: '/api/courses/create',
    method: 'post',
    data
  });
}

// 更新课程
export function updateCourse(data) {
  return request({
    url: '/api/courses/update',
    method: 'put',
    data
  });
}

// 删除课程
export function deleteCourse(id) {
  return request({
    url: `/api/courses/${id}`,
    method: 'delete'
  });
} 